/*
 * @Description:: 请补充填写
 * @Version: 请配置版本号
 * @Author: xiaobai
 * @Date: 2021-10-08 16:54:11
 * @LastEditors: xiaobai
 * @LastEditTime: 2021-10-08 16:54:23
 * @FilePath: /admin-web/src/libs/util.js
 */

/**
* @description: 导出函数
* @param {type}
* @return:
*/
export const exportList = function(data, title) {
  const blob = new Blob([data], {
    type: 'application/vnd.ms-excel;charset=UTF-8'
  })
  const objectUrl = URL.createObjectURL(blob)
  const fileName = title + '.xls'
  const a = document.createElement('a')
  document.body.appendChild(a)
  a.download = fileName
  a.href = objectUrl
  a.click()
  URL.revokeObjectURL(a.href)
  document.body.removeChild(a)
}
